package com.system.controller;

import com.system.pojo.Logistics;
import com.system.service.LogisticsService;
import com.system.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author yjymm
 * @date 2019-12-23 11:16
 */
@Controller
@ResponseBody
@RequestMapping("/logistics")
public class LogisticsController {

    @Autowired
    private LogisticsService ls;

    @RequestMapping(value = "/update",method = RequestMethod.POST)
    public ResultVo<Logistics> insert (@RequestBody Logistics logistics){
        ResultVo<Logistics> resultVo = new ResultVo<Logistics>();
        try {
            resultVo = ls.insert(logistics);
        }catch (Exception e){
            e.printStackTrace();
            resultVo.setMessage("修物流单号失败");
        }finally {
            return resultVo;
        }
    }
}
